<?php
$categoryId = $categoryId?? '';
?>
<form method="get" class="flex gap-2">
    <input
        type="text"
        name="q"
        value="<?= htmlspecialchars($_GET['q'] ?? '') ?>"
        placeholder="按书名/ISBN/作者搜索..."
        class="border p-2 rounded w-64"
    >
    <input
        type="hidden"
        name="category_id"
        value="<?= $categoryId?>"
    >
    <button type="submit" class="btn-primary">搜索</button>
</form>